import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'

// 加载LAreaData.js这个城市数据文件
import LAreaDataObj from '../../assets/js/LAreaData1.js';
// 加载调用省份的操作
import citypickerhc from '../../assets/js/citypickerhc.js';


@Component({
  selector: 'app-mall-list',
  templateUrl: './mall-list.component.html',
  styleUrls: ['./mall-list.component.scss']
})
export class MallListComponent implements OnInit {

  constructor(public router: Router) { }

  ngOnInit(): void {

    window.scrollTo(0, 0);

    var swiper = new Swiper('.swiper_container_rem', {
      slidesPerView: 3,
      spaceBetween: 20,
      //   centeredSlides: true,
      //   pagination: {
      //     el: '.swiper-pagination',
      //     clickable: true,
      //   },
    });

    // 选择城市
    $("#citypick").click(function () {
      citypickerhc.citypicker(LAreaDataObj.LAreaData, $);
    });


    // 选择品牌
    $(function () {
      $(".mall_list_top .c1").mousedown(function () {
        $('#xuanc').show();
      })
      $('#xuanc .auto_button').mousedown(function () {
        $('#xuanc').hide();
      })
    })

    // 头部高度计算
    $(function () {
      var height = $('#top').height();
      $('.mall_list_k').css('padding-top', height);
    })

    // 筛选等
    $(function () {
      $('.mall_list_top .c2>p').mousedown(function () {
        $('.mall_list_top .c2 .jiage').hide();
        $(this).next().show();
      })
      $('.mall_list_top .c2 .no').mousedown(function () {
        $('.mall_list_top .c2 .jiage').hide();
      })
      var Aa = $('.mall_list_top .c2 .jiage .top a');
      Aa.mousedown(function () {
        $(Aa).siblings().removeClass('xuanz');
        $(this).addClass('xuanz');
      })
    })
  }


  getmallListXq() {
    this.router.navigate(['/mall-list-xq'])
  }
}
